package com.thermofisher.dsc.amanda.model.dto.product;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.thermofisher.dsc.amanda.model.BaseModel;

import java.util.Date;
import java.util.List;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import java.math.BigDecimal;
import java.text.DecimalFormat;


@Getter
@Setter
public class ProductDto extends BaseModel {

    private String skuNO;

    private String skuDesc;

    private String skuSize;

    @JsonIgnore
    private BigDecimal lpCNY;

    private String lpCNYStr;

    private Integer amDisc;

    private Integer rmDisc;

    private Integer sdDisc;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    private Date receiveTime;

    private List<InventoryDto> inventoryList;

    public String getlpCNYStr() {
        if (lpCNY != null){
            DecimalFormat decimalFormat = new DecimalFormat("###,###.00");
            return decimalFormat.format(lpCNY);
        }
        return null;
    }

}
